package com.scau.ums.controller;

import com.scau.ums.service.imp.password.AdminPasswordImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class AdminController {

    @Autowired
    private AdminPasswordImp passwordImp;

    //接受"/adminEntrance"的get请求，显示登录页面"/jsp/adminEntrance.jsp"
    @RequestMapping(value = "/adminEntrance", method = RequestMethod.GET)
    public String toAdminEntrance() {
        return "adminEntrance";
    }

    @RequestMapping(value = "/reset",method = RequestMethod.GET)
    @ResponseBody
    public String resetAdminPassword()
    {
        passwordImp.resetPassword("1");
        return "reset OK";
    }
}